Pass num_dim to geoclaw TopographyData and DTopoData - #208
Conversation
Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5
PR Detailed Description -- Summarized by ClaudeCompanion: clawpack/geoclaw#745, which adds the Why this is needed
Those classes cannot infer the dimension themselves, and self.add_data(amrclaw.GaugeData(num_dim=num_dim), 'gaugedata')
self.add_data(amrclaw.RegionData(num_dim=num_dim), 'regiondata')
self.add_data(amrclaw.AdjointData(num_dim=num_dim), 'adjointdata')
The changeFour call sites needed it — def _make_dim_aware(cls, num_dim):
try:
return cls(num_dim=num_dim)
except TypeError:
return cls()
On the fallbackIt exists specifically for mixed clawutil/geoclaw checkouts, which are routine It is deliberately temporary and the docstring says so: once the geoclaw VerificationExercised against the geoclaw side of the pair:
The fallback path was confirmed by construction rather than by pinning an old |
This ensures that older versions of clawpack do not break if
num_dimis not an argument toTopographyDataandDTopoData. The valuenum_dimis now required in these to support the 1D code.